package com.zuoban.sms.properties;

import com.zuoban.sms.properties.other.AliyunSmsProperties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;

@Data
@ConfigurationProperties(prefix = "sms")
public class SmsProperties {

    /**
     * 是否开启短信注入
     */
    private boolean enable;

    /**
     * 短信平台
     */
    private String type;

    private AliyunSmsProperties aliyun;

    public enum SmsType {
        ALIYUN("aliyun"),HUAWEI("huawei");

        private final String plat;

        SmsType(String plat){
            this.plat = plat;
        }

        public String getPlat() {
            return plat;
        }
    }

    @Bean
    @ConfigurationProperties(prefix = "sms.aliyun")
    public AliyunSmsProperties aliyunSmsProperties(){
        return new AliyunSmsProperties();
    }

    // 如需其他平台 请自行整合...
}
